/**
 * Created with IntelliJ IDEA.
 * User: wenxiwen
 * Date: 2022/3/22
 * Time: 10:20
 * Description: No Description
 */
import java.util.Scanner;
public class TestDemo {
    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5,6,7,8,9,10};
        int[] array = new int[]{1,2,3,4,5,6,7,8,9,10};
        int[] array1 = new int[10];

        int[] array3;
        array3 = new int[]{1,2,3,4,5,6,7,8,9,10};
    }
    public static void fun1(int[] arr ,int n) {
        if (n == 0) {
            return;
        }
        fun1(arr,n - 1);
        System.out.print(arr[n-1] + " ");
    }
    public static void fun(int[] array , int n) {
        if( n == 5) {
            return;
        }
        fun(array,n + 1);
        System.out.print(array[n] + " ");
    }
    public static void main2(String[] args) {
        int[] array = {1,2,3,4,5};
        fun(array,0);
        System.out.println();
        fun1(array,5);
    }
    public static int add(int n) {
        if(n < 9) {
            return n;
        }
        return add(n / 10) + n % 10;
    }
   public static  void main1(String[] args) {
       Scanner scan = new Scanner(System.in);
       int a = scan.nextInt();
       System.out.println(add(a));
   }
}